package com.ssy.lingxi.product.entity.platform;

import com.fasterxml.jackson.annotation.JsonBackReference;

import javax.persistence.*;
import java.io.Serializable;

/**
 * 平台后台 - 物料规则适用会员
 * @author 彭冬冬
 * @version 2.0.0
 * @date 2022/3/25 10:06
 */
@Entity
@Table(schema = "public",
        name="product_platform_material_process_member"
)
public class PlatformMaterialProcessMemberDO implements Serializable {
    private static final long serialVersionUID = 1308754705024240311L;

    /**
     * 主键Id
     */
    @Id
    @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "product_platform_material_process_member_seq")
    @SequenceGenerator(sequenceName = "product_platform_material_process_member_seq", name = "product_platform_material_process_member_seq", allocationSize = 1)
    private Long id;

    /**
     *多对一双向关联平台物料流程规则
     */
    @JsonBackReference
    @ManyToOne(cascade = {CascadeType.REFRESH},fetch = FetchType.LAZY)
    @JoinColumn(name = "product_platform_material_id")
    private PlatformMaterialProcessDO process;

    /**
     * 适用的会员Id
     */
    @Column
    private Long memberId;

    /**
     * 适用的会员角色Id
     */
    @Column
    private Long roleId;

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public PlatformMaterialProcessDO getProcess() {
        return process;
    }

    public void setProcess(PlatformMaterialProcessDO process) {
        this.process = process;
    }

    public Long getMemberId() {
        return memberId;
    }

    public void setMemberId(Long memberId) {
        this.memberId = memberId;
    }

    public Long getRoleId() {
        return roleId;
    }

    public void setRoleId(Long roleId) {
        this.roleId = roleId;
    }
}
